#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;

/*
author:liuqx
2024/7/17 14:10-14:14
https://www.luogu.com.cn/problem/CF1722A
*/
int main()
{
	int times;
	cin >> times;
	string name = "Timur";
	sort(name.begin(), name.end());
	for (int index = 0; index < times; index++)
	{
		int len;
		cin >> len;
		string temp;
		cin >> temp;
		sort(temp.begin(), temp.end());
		if (name == temp)
		{
			cout << "Yes\n";
		}
		else
		{
			cout << "No\n";
		}
	}
}